﻿using System;
using System.Collections.Generic;
using ProjScan.Submodules.Shader_Analysis.Build;
using ProjScan.Tools;

namespace ProjScan.Submodules.Shader_Analysis
{
	// Token: 0x0200017E RID: 382
	internal class ShaderInfoManager : Singleton<ShaderInfoManager>
	{
		// Token: 0x06000D54 RID: 3412 RVA: 0x0003B618 File Offset: 0x00039818
		public void Reset()
		{
			bool flag = this.buildInfoDictionary != null;
			if (flag)
			{
				this.buildInfoDictionary.Clear();
			}
			bool flag2 = this.buildInfoList != null;
			if (flag2)
			{
				this.buildInfoList.Clear();
			}
		}

		// Token: 0x06000D55 RID: 3413 RVA: 0x0003B65C File Offset: 0x0003985C
		public void RegisterShaderInfo()
		{
			int count = this.buildInfoList.Count;
			for (int i = 0; i < count; i++)
			{
				ShaderBuildInfo shaderBuildInfo = this.buildInfoList[i];
				this.buildInfoDictionary[shaderBuildInfo.name] = shaderBuildInfo;
			}
		}

		// Token: 0x06000D56 RID: 3414 RVA: 0x00006CF9 File Offset: 0x00004EF9
		public void AddShaderBuildInfo(ShaderBuildInfo newShaderBuildInfo)
		{
			this.buildInfoList.Add(newShaderBuildInfo);
			this.buildInfoDictionary[newShaderBuildInfo.name] = newShaderBuildInfo;
		}

		// Token: 0x06000D57 RID: 3415 RVA: 0x0003B6A8 File Offset: 0x000398A8
		public ShaderBuildInfo GetShaderInfo(string name)
		{
			bool flag = this.buildInfoDictionary == null;
			ShaderBuildInfo result;
			if (flag)
			{
				result = null;
			}
			else
			{
				ShaderBuildInfo shaderBuildInfo;
				this.buildInfoDictionary.TryGetValue(name, out shaderBuildInfo);
				result = shaderBuildInfo;
			}
			return result;
		}

		// Token: 0x04000825 RID: 2085
		public readonly List<ShaderBuildInfo> buildInfoList = new List<ShaderBuildInfo>();

		// Token: 0x04000826 RID: 2086
		private readonly Dictionary<string, ShaderBuildInfo> buildInfoDictionary = new Dictionary<string, ShaderBuildInfo>();
	}
}
